home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12030 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: sguit@aol.com (SGUIT)
  3. Newsgroups: comp.lang.c++
  4. Subject: CFile read problem.........
  5. Date: 17 Mar 1996 16:43:39 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4ii12b$brl@newsbf02.news.aol.com>
  9. Reply-To: sguit@aol.com (SGUIT)
  10. NNTP-Posting-Host: newsbf02.mail.aol.com
  11.  
  12. I'm having problems with the following code:
  13.  
  14.   UINT BytesRead;
  15.   char FromFile[25];
  16.   
  17.   // Create an object readMe of class CFile
  18.   CFile readMe((buffer2),"\\config.dat", CFile::modeRead );
  19.    
  20.   // REad the file into FromFile
  21.   BytesRead = readMe.Read ( FromFile, 25); 
  22.   
  23.   // Add a null terminator
  24.   FromFile[BytesRead] = 0;  
  25.  
  26. note:  buffer2 is a string that contains the path where the config.dat
  27. file is located.
  28. We do not know the proper syntax required to use the buffer2 and
  29. config.dat file
  30. together. The code listed above does not work for this reason. We've tried
  31. many things
  32. without any luck. If we use this code: CFile
  33. readMe("C:\\Prog\\config.dat",
  34. CFile::modeRead ); it works fine....However,  we need to use it with the
  35. buffer2 string
  36. which contains the path to the directory. We know that buffer2 string
  37. holds the path since
  38. we used "trace" to verify it.
  39.  
  40. Does anyone know how to accomplish this?
  41. Thanks
  42. Steve t.
  43. sthomas@together.net
  44.  
  45.  
  46.  
  47.  
  48.  
  49.